import React, { FC, useCallback, useEffect } from "react";

interface TestProps {
  data: number;
  setData: (params: number) => void;
}

const Test: FC<TestProps> = ({ data, setData, ...props }) => {
  console.log(data);

  const Array = data;
  const getData = () => {
    console.log(data);
  };
  useEffect(() => {
    getData();
  }, []);

  return (
    <div
      onClick={() => {
        setData(data + 1);
      }}
    >
      dainji
    </div>
  );
};

export default Test;
